home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / PolygonsMenu.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  9.9 KB  |  259 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  1 April 1997
  22. //
  23. //  Description:
  24. //      This implements the "Polygons" menu on the modeling menubar.
  25. //
  26.  
  27. global proc string polygonsMenuItemToShelf (string $item)
  28. {
  29.     return $item;
  30. }
  31.  
  32.  
  33.  
  34. proc PolyToolOptionsMenu(string $parent)
  35. //
  36. // Description:
  37. //        Polygon tool options menu
  38. //
  39. {
  40.     setParent -m $parent;
  41.  
  42.     menuItem -l "Keep New Faces Planar" -ecr false -cb false
  43.         -ann "Keep New Faces Planar: Check to maintain newly created faces planar"
  44.         -dmc "polygonsMenuItemToShelf \"togglePolyPlanarConstraints\""
  45.         -c "togglePolyPlanarConstraints" togglePlanarItem;
  46.  
  47.     menuItem -l "Keep Faces Together" -ecr false -cb false 
  48.         -dmc "polygonsMenuItemToShelf \"togglePolyMoveComponents\""
  49.         -ann "Keep Faces Together: Check for Extrude/Extract/Duplicate to move the faces as a whole instead of separately"
  50.         -c "togglePolyMoveComponents" toggleGroupItem;
  51.  
  52.     menuItem -divider true;
  53.  
  54.     menuItem -l "Convert Selection" -ecr false -cb false
  55.         -ann "Convert Selection: Automatic conversion of selected object into its appropriate components"
  56.         -dmc "polygonsMenuItemToShelf \"togglePolyAutoConvertAction\""
  57.         -c "togglePolyAutoConvertAction" toggleAutoConvertItem;
  58.  
  59.     menuItem -l "Smart Command Settings" -ecr false -cb false
  60.         -ann "Smart Command Settings: If selection is inadequate for required command, install selection constraints and display attributes"
  61.         -dmc "polygonsMenuItemToShelf \"togglePolyAutoInstallAction\""
  62.         -c "togglePolyAutoInstallAction" toggleAutoInstallItem;
  63.  
  64.     menuItem -l "Reset to Default Settings" -ecr false
  65.         -ann "Reset to Default Settings: Remove selection constraints and display attributes that may have been set for previous command"
  66.         -dmc "polygonsMenuItemToShelf \"polyInstallAction\""
  67.         -c "polyInstallAction";
  68. }
  69.  
  70.  
  71. //////////////////////////////////////////////////////////////////////
  72.  
  73. global proc PolygonsMenu(string $parent)
  74. //
  75. // Description:
  76. //        Polygon creation menu
  77. //
  78. {
  79.     if (! `isTrue "PolygonsExists"`) return;
  80.     
  81.     setParent -m $parent; 
  82.  
  83.     if (`menu -q -ni $parent` == 0) {
  84.  
  85.  
  86.     menuItem -l "Create Polygon Tool" -i "polyCreateFacet.xpm"
  87.         -ann "Create Polygon Tool: Create polygon faces"
  88.         -ddc "setToolTo polyCreateFacetContext ; polyCreateFacetCtx -e -pc `optionVar -q polyKeepFacetsPlanar` polyCreateFacetContext; toolPropertyWindow"
  89.         -dmc "polygonsMenuItemToShelf \"setToolTo polyCreateFacetContext ; polyCreateFacetCtx -e -pc `optionVar -q polyKeepFacetsPlanar` polyCreateFacetContext\""
  90.         -c "CreatePolygonTool" createItem;
  91.         menuItem -optionBox 1 -i "polyCreateFacet.xpm" 
  92.             -annotation "Create Polygon Tool Option Box" 
  93.             -l "Create Polygon Tool Option Box" -c "CreatePolygonToolOptions" 
  94.         createOptionItem;
  95.  
  96.     menuItem -l "Append to Polygon Tool" -i "polyAppendFacet.xpm"
  97.         -ann "Append to Polygon Tool: Append a face to the selected shell. Select border edges to append a face to"
  98.         -ddc "setToolTo polyAppendFacetContext ; polyAppendFacetCtx -e -pc `optionVar -q polyKeepFacetsPlanar` polyAppendFacetContext; toolPropertyWindow"
  99.         -dmc "polygonsMenuItemToShelf \"setToolTo polyAppendFacetContext ; polyAppendFacetCtx -e -pc `optionVar -q polyKeepFacetsPlanar` polyAppendFacetContext\""
  100.         -c "AppendToPolygonTool" appendItem;
  101.         menuItem -optionBox 1 -i "polyAppendFacet.xpm" 
  102.             -annotation "Append to Polygon Tool Option Box" 
  103.             -l "Append to Polygon Tool Option Box" 
  104.             -ecr false 
  105.             -c "AppendToPolygonToolOptions" appendOptionItem;
  106.  
  107.     //////////////////////////////////////////////////////////////////////
  108.     menuItem -divider true;        
  109.     
  110.     menuItem -l "Combine"  -ecr true 
  111.         -i "polyUnite.xpm"
  112.         -ann "Combine: Combine the selected polygon objects into one single object to allow operations such as merges or face trims"
  113.         -dmc "polygonsMenuItemToShelf \"polyPerformAction polyUnite o 0\""
  114.         -c "CombinePolygons";
  115.  
  116.     menuItem -l "Transfer"
  117.         -ann "Transfer: Select two objects to be crossed"
  118.         -c "performPolyTransfer 0" -i "polyTransfer.xpm" ;
  119.  
  120.     menuItem -optionBox 1
  121.         -l "Transfer Option Box" -ann "Transfer Option Box"
  122.         -c "performPolyTransfer 1" -ecr false -i "polyTransfer.xpm" ;
  123.  
  124.     menuItem -l "Booleans" -sm 1 -to 1;
  125.         menuItem -l "Union" -ecr true
  126.             -i "polyBooleansUnion.xpm" 
  127.             -ann "Union: Performs a boolean Union on the selected polygon objects, creating a new object"
  128.             -dmc "polygonsMenuItemToShelf \"polyPerformAction \\\"polyBoolOp -op 1\\\" o 0\""
  129.             -c "PolygonBooleanUnion";
  130.         menuItem -l "Difference" -ecr true
  131.             -i "polyBooleansDifference.xpm" 
  132.             -ann "Difference: Performs a boolean Difference on the selected polygon objects, creating a new object"
  133.             -dmc "polygonsMenuItemToShelf \"polyPerformAction \\\"polyBoolOp -op 2\\\" o 0\""
  134.             -c "PolygonBooleanDifference";
  135.         menuItem -l "Intersection" -ecr true
  136.             -i "polyBooleansIntersection.xpm" 
  137.             -ann "Intersection: Performs a boolean Intersection on the selected polygon objects, creating a new object"
  138.             -dmc "polygonsMenuItemToShelf \"polyPerformAction \\\"polyBoolOp -op 3\\\" o 0\""
  139.             -c "PolygonBooleanIntersection";
  140.         setParent -m ..;
  141.  
  142.     // m2.1 Mirror
  143.     menuItem -l "Mirror Geometry" -i "polyMirrorGeometry.xpm"
  144.         -ecr true
  145.         -dmc "performPolyMirror 2"
  146.         -ddc "performPolyMirror 1"
  147.         -c "MirrorPolygonGeometry"
  148.         -ann "Mirror: Mirror geometry across an axis."
  149.         mirrorItem;
  150.     menuItem -optionBox 1
  151.         -ecr false
  152.         -i "polyMirrorGeometry.xpm"
  153.         -ann "Mirror Geometry Option Box"
  154.         -l "Mirror Geometry Option Box"
  155.         -c "MirrorPolygonGeometryOptions"
  156.         mirrorOptionItem;
  157.  
  158.     //////////////////////////////////////////////////////////////////////
  159.     menuItem -divider true;        
  160.  
  161.     menuItem -l "Smooth"  -ecr true 
  162.         -i "polySmooth.xpm"
  163.         -ann "Smooth: Add polygons to the selected polygon objects to smooth them"
  164.         -ddc "performPolySmooth 1"
  165.         -dmc "performPolySmooth 2" -c "SmoothPolygon"; 
  166.     menuItem -optionBox 1 -i "polySmooth.xpm" 
  167.         -annotation "Smooth Option Box"  
  168.         -l "Smooth Option Box" -ecr false -c "SmoothPolygonOptions"; 
  169.  
  170.     menuItem -l "Smooth Proxy"  -ecr true 
  171.         -i "polySmoothProxy.xpm"
  172.         -ann "Smooth: Add polygons to the selected polygon objects to smooth them"
  173.         -ddc "performSmoothProxy 1"
  174.         -dmc "performSmoothProxy 2" -c "SmoothProxy"; 
  175.     menuItem -optionBox 1 -i "polySmoothProxy.xpm" 
  176.         -annotation "Smooth Option Box"  
  177.         -l "Smooth Option Box" -ecr false -c "SmoothProxyOptions"; 
  178.  
  179.     menuItem -l "Average Vertices"
  180.         -ann "Average Vertices: Move selected vertices to smooth shape"
  181.         -c "performPolyAverageVertex 0" -i "polyAverageVertex.xpm";
  182.     menuItem -optionBox 1
  183.         -l "Average Vertices Option Box" -ann "Average Vertices Option Box"
  184.         -c "performPolyAverageVertex 1" -ecr false -i "polyAverageVertex.xpm";
  185.  
  186.     menuItem -l "Triangulate" -ecr true -i "polyTriangulate.xpm"
  187.         -dmc "polygonsMenuItemToShelf \"polyPerformAction polyTriangulate f 0\""
  188.         -c "Triangulate"
  189.         -ann "Triangulate: Change the selected faces into triangles"
  190.         triangulateItem;
  191.     
  192.     menuItem -l "Quadrangulate" -ecr true -i "polyQuad.xpm"
  193.         -ddc "performPolyQuadrangulate 1"
  194.         -dmc "performPolyQuadrangulate 2" 
  195.         -ann "Quadrangulate: Change the selected faces into quadrilaterals"
  196.         -c "Quadrangulate" quadrangulateItem;
  197.     menuItem -optionBox 1 -i "polyQuad.xpm" 
  198.         -annotation "Quadrangulate Option Box" 
  199.         -l "Quadrangulate Option Box" -ecr false -c "QuadrangulateOptions" 
  200.         quadrangulateOptionItem;
  201.  
  202.     // m2.1 Cleanup
  203.     menuItem -l "Cleanup" -ecr true -i "polyCleanup.xpm"
  204.       -dmc "performPolyCleanup 2"
  205.       -ddc "performPolyCleanup 1"
  206.       -c "CleanupPolygon"
  207.       -ann "Cleanup : Select, or select and remove, different types of polygonal geometry"
  208.       cleanupItem;
  209.     menuItem -optionBox 1
  210.       -i "polyCleanup.xpm"
  211.       -ann "Cleanup Option Box"
  212.       -l "Cleanup Option Box" -ecr false -c "CleanupPolygonOptions"
  213.       cleanupOptionItem;
  214.  
  215.     menuItem -divider true;
  216.  
  217.     // m2.1 Reduction
  218.     menuItem -l "Reduce" -ecr true -i "polyReduce.xpm"
  219.       -dmc "performPolyReduce 2"
  220.       -ddc "performPolyReduce 1"
  221.       -c "ReducePolygon"
  222.       -ann "Reduce : Reduce number of polygonal components for selected objects"
  223.       reductionItem;
  224.     menuItem -optionBox 1
  225.       -i "polyReduce.xpm"
  226.       -ann "Poly Reduce Option Box"
  227.       -l "Poly Reduce Option Box" -ecr false
  228.       -c "ReducePolygonOptions"
  229.       reductionOptionItem;
  230.  
  231.     menuItem
  232.         -label "Paint Reduce Weights Tool"
  233.         -annotation (getRunTimeCommandAnnotation("PaintReduceWeightsTool"))
  234.         -image "polyReduce.xpm"
  235.         -command "PaintReduceWeightsTool"
  236.         -dragDoubleClickCommand "PaintReduceWeightsToolOptions"
  237.         ;
  238.  
  239.     menuItem -optionBox true
  240.         -annotation (getRunTimeCommandAnnotation("PaintReduceWeightsToolOptions"))
  241.         -image "polyReduce.xpm" 
  242.         -command "PaintReduceWeightsToolOptions" 
  243.         ;
  244.  
  245.     menuItem -divider true;
  246.  
  247.     // Options
  248.     string $optItem=`menuItem -l "Tool Options" -sm 1 -to 1 -aob true polyOptionsItem`;
  249.     PolyToolOptionsMenu $optItem;
  250.     setParent -m ..;
  251.  
  252.  
  253.     menuItem -e -cb `optionVar -q polyKeepFacetsPlanar` togglePlanarItem;
  254.     menuItem -e -cb `optionVar -q polyKeepFacetsGrouped` toggleGroupItem;
  255.     menuItem -e -cb `optionVar -q polyAutoInstallAction` toggleAutoInstallItem;
  256.     menuItem -e -cb `optionVar -q polyAutoConvertAction` toggleAutoConvertItem;
  257.     }
  258. }
  259.